package com.EAsystem.mapper;

import com.EAsystem.entity.HomeworkSubmission;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HomeworkSubmissionMapper {
    
    // 插入作业提交
    int insertHomeworkSubmission(HomeworkSubmission homeworkSubmission);
    
    // 更新作业提交
    int updateHomeworkSubmission(HomeworkSubmission homeworkSubmission);
    
    // 根据ID删除作业提交
    int deleteHomeworkSubmissionById(Long id);
    
    // 根据ID查询作业提交
    HomeworkSubmission findHomeworkSubmissionById(Long id);
    

    
    // 分页查询所有作业提交
    List<HomeworkSubmission> findAllHomeworkSubmissionsWithPage();
    
    // 根据作业ID查询作业提交
    List<HomeworkSubmission> findHomeworkSubmissionsByHomeworkId(Long homeworkId);
    
    // 根据学生ID查询作业提交
    List<HomeworkSubmission> findHomeworkSubmissionsByStudentId(Long studentId);
    
    // 根据作业ID和学生ID查询作业提交
    HomeworkSubmission findHomeworkSubmissionByHomeworkIdAndStudentId(Long homeworkId, Long studentId);
    
    // 条件查询作业提交
    List<HomeworkSubmission> findHomeworkSubmissionsByCondition(HomeworkSubmission homeworkSubmission);
    
    // 评分
    int gradeHomeworkSubmission(Long id, Double score);
}